﻿/*
 * OverviewManager
 * 
 * Copyright (c) Adam Sida, asida@centrum.cz
 * 
 * All rights reserved.
 */
using System.Drawing;
using Petra.Gis.Geometry.Support;


namespace Petra.Gis.Geometry.Image

{
  /// <summary>
  /// provides GIS specific functionality for raster images display
  /// to accelerate super large image rendering this manager does this:
  /// 1. for tiff image scans for overviews, if found uses them
  /// 2. for other images, prepares overview bitmaps on disk as files
  /// and creates special configuration file with map of these overviews
  /// </summary>
  public class OverviewManager
  {
    private string _workFolderPath;
    private long _maxfolderByteSize;

    public OverviewManager()
    { 
      
    }

    public OverviewManager(string workFolderPath, long cacheByteSize)
    {
      _workFolderPath = workFolderPath;
      _maxfolderByteSize = cacheByteSize;
    }


    /// <summary>
    /// clear all files in workFolder
    /// </summary>
    public void ClearCache()
    { 
    
    }

    /// <summary>
    /// main function of OverviewManager. Lookup for requested image in cache.
    /// if not found then creates new cache entry for it, if necessary prepares overviews
    /// and then displays image part (or whole image if fully inside)
    /// clipped by orthogonal rectangular clipArea
    /// function doesn't do SRS transformations and doesn't use SRS info
    /// </summary>
    /// <param name="image">valid image geometry</param>
    /// <param name="clipArea">world coordinates of clipping area</param>
    /// <returns></returns>
    public Bitmap RenderImage(SpatialReferencedImage image, BoundingBox clipArea, Size areaPixelSize)
    {
      return new Bitmap("");
    }


  }
}
